import 'package:flutter/material.dart';

import 'ink_widget.dart';

/// todo: 渐变按钮
gradientButton(msg,{double? circular,Function()? onTap,Color? bgColor,ShapeBorder? shape }){
  return Container(
    decoration: BoxDecoration(
      gradient: bgColor !=null ?null:const LinearGradient(colors: [
        Color(0xff9ad02f),
        Color(0xff7eba21),
        Color(0xff4d8405),
      ],begin: Alignment.topCenter,end: Alignment.bottomCenter),
      borderRadius: BorderRadius.circular(circular ?? 4),
      color: bgColor,
    ),
    child: MaterialButton(
      onPressed: (){
        if(onTap!=null) onTap();
      },
      child: InkWidget.text("$msg",color: Colors.white),
      color: Colors.transparent,
      elevation: 0,
      disabledElevation: 0,
      focusElevation: 0,
      hoverElevation: 0,
      highlightElevation: 0,
      minWidth: 100,
      shape: shape,
    ),
    height: 40,
  );
}